package com.herui.sdyu_lib.http.callback;

import com.herui.sdyu_lib.http.utils.ClassTypeReflect;

import java.lang.reflect.Type;



public interface Callback {

    public abstract class CommonCallback<T> {

        public Type type;

        public CommonCallback() {
            type = ClassTypeReflect.getModelClazz(getClass());
        }

        public abstract void onSuccess(T result);

        public abstract void onError(Throwable e, String code, String message);

        // void onCancelled(CancelledException cex);
        //
        // void onFinished();
    }

    public abstract class ProgressDownCallback<T> extends CommonCallback<T> {
        public abstract void onDownLoading(long total, long current, boolean isDownloading);
    }

    public abstract class ProgressUpCallback<T> extends CommonCallback<T> {
        public abstract void onUpLoading(long total, long current, boolean isDownloading);
    }

    public abstract class ProgressCallback<T> extends ProgressDownCallback<T> {
        public abstract void onUpLoading(long total, long current, boolean isDownloading);
    }
}
